Method and system for providing implicit edge antialiasing

ABSTRACT

A method and system for providing antialiasing of a graphical image on a display from data describing at least one object is disclosed. The display includes a plurality of pixels. The method and system include providing a plurality of fragments for the at least one object. A portion of the plurality of fragments intersects a pixel of the plurality of pixels. Each of the plurality of fragments includes a depth value, a slope of the depth value, and an indication of a portion of a corresponding pixel that is intersected. The method and system include calculating a plurality of subpixel depth values for a fragment of the plurality of fragments. The plurality of subpixel depth values is calculated using the depth value and the slope of the depth value of the fragment. The method and system include determining whether to store a portion of the fragment based on the plurality of subpixel depth values for the fragment and the indication of the extent the corresponding pixel is intersected by the fragment. The method and system also include storing the portion of the fragment if it has been determined that the portion of the fragment is to be stored. The method and system also include repeating the calculating, determining, and storing steps for each remaining fragment in the portion of the plurality of fragments. The method and system also include providing antialiased data for the pixel based on a second portion of the plurality of fragments that have been stored.

CROSS-REFERENCE TO RELATED APPLICATIONS

[0001] The present invention is related co-pending U.S. patentapplication Ser. No. ______, entitled “METHOD AND SYSTEM FOR PROVIDINGEDGE ANTLkLIASING” (945P) filed on ______ and assigned to the assigneeof the present application. The present invention is also related toco-pending U.S. Patent Application Serial No., entitled “METHOD ANDSYSTEM FOR PROVIDING EDGE ANTIALIASING USING A SINGLE BLENDING UNIT”(1198P) filed on and assigned to the assignee of the presentapplication. The present invention is related co-pending U.S. patentapplication Ser. No. 08/624,261, entitled “METHOD AND APPARATUS FORIDENTIFYING AN ELIMINATING THREE-DIMENSIONAL OBJECTS VISUALLY OBSTRUCTEDFORM A PLANAR SURFACE” filed on Mar. 29, 1996 and assigned to theassignee of the present application. The present invention is alsorelated to co-pending U.S. patent application Ser. No. 08/624,260,entitled “GRAPHICS PROCESSORS, SYSTEM AND METHOD FOR GENERATING SCREENPIXELS IN RASTER ORDER UTILIZING A SINGLE INTERPOLATOR” filed on Mar.29, 1996 and assigned to the assignee of the present application.

FIELD OF THE INVENTION

[0002] The present invention relates to displaying graphical image on acomputer system and more particularly to a method and system forproviding antialiasing of implicit edges while maintaining processingspeed and using less memory.

BACKGROUND OF THE INVENTION

[0003] A conventional computer graphics system can display graphicalimages of objects on a display. The display includes a plurality ofdisplay elements, known as pixels, typically arranged in a grid. Inorder to display objects, the conventional computer graphics systemtypically breaks each object into a plurality of polygons. Aconventional system then renders the polygons in a particular order. Fora three-dimensional scene, the opaque polygons are generally renderedfrom front to back as measured from the viewing plane of the display.Translucent polygons are desired to be rendered from back to front.Similarly, a two-dimensional scene can be displayed. In such a case,polygons are rendered based on their layer. Shallower layers occludedeeper layers.

[0004] Each of the polygons includes mathematically defined edges. Whenrendering an image, the conventional system often renders diagonal linesor polygon edges that are not perfectly horizontal or vertical. Becauseeach pixel has finite physical dimensions, edges which are nothorizontal or vertical may appear jagged. For example, consider eachpixel to be a square. A diagonal line or edge rendered using the squarepixels will appear jagged, similar to a staircase. This effect is knownas aliasing.

[0005] Implicit edges are edges that are visible in a graphical image,but that are not explicitly defined. For example, in a graphical image,objects may intersect each other. The intersection appears as an edgethat is not explicitly defined. Implicit edges are due to differences indepth values of the polygons whose intersection forms the implicit edge.The depth value can include the distance from the viewing plane, a wvalue, or layer order. The depth values at the implicit edge, theintersection of the polygons, should be virtually identical. However,slight differences in depth values of the polygons from one pixel to thenext dictate which polygon is visible at a selected pixel. Because ofthese slight differences in depth values, the polygon considered to bevisible can change from pixel to pixel. This creates the implicit edge.Each pixel still has a finite area. As a result, the implicit edge isalso subject to aliasing.

[0006] In order to reduce aliasing, conventional systems performantialiasing. Antialiasing helps reduce the effect that the physicaldimension of the pixels has on the appearance of objects beingdisplayed. Diagonal lines and edges appear smoother. It would bedesirable if the antialiasing performed is also capable of providingantialiasing for implicit edges.

[0007] Some conventional systems utilize conventional supersampling inorder to perform antialiasing for implicit edges. Supersampling istypically performed for a portion of the display, called a tile, or theentire display at a time. Each pixel in the tile or display isconsidered to be an M×N matrix subpixels. Data for each polygon in thetile is evaluated at each subpixel. Thus, the depth value, color,texture, and other data for the polygon can differ in and is evaluatedat each subpixel. Data for the subpixels in each pixel in the tile arecombined to provide the data for each pixel in the tile. Becausesupersampling evaluates and combines depth values for subpixels,supersampling can help smooth out the staircasing effect on implicitedges. However, the system requires sufficient memory to retain data forthe M×N subpixels in each pixel in a tile to perform supersampling.Therefore, a large amount of memory is required. It must also be ensuredthat there are not artifacts at the seams between tiles. This slowsprocessing. Furthermore, much more data is processed for each pixel inthe display. Supersampling is thus computation intensive and relativelyslow.

[0008] Some conventional systems address some of the problems insupersampling by performing adaptive supersampling. Adaptivesupersampling first identifies areas where supersampling may be desired,for example at an implicit edge. Once the area of an implicit edge isidentified, supersampling is performed for a tile in the region of theimplicit edge. In areas where there are no implicit edges, supersamplingis not performed. Although adaptive supersampling improves processingspeed by reducing the areas subjected to supersampling, a large amountof memory is still required.

[0009] Accordingly, what is needed is a system and method that iscapable of providing antialiasing for implicit edges and which consumesless memory. The present invention addresses such a need.

SUMMARY OF THE INVENTION

[0010] The present invention provides a method and system for providingantialiasing of a graphical image on a display from data describing atleast one object. The display includes a plurality of pixels. The methodand system comprise providing a plurality of fragments for the at leastone object. A portion of the plurality of fragments intersects a pixelof the plurality of pixels. Each of the plurality of fragments includesa depth value, a slope of the depth value, and a portion of acorresponding pixel that is intersected. The method and system comprisecalculating a plurality of subpixel depth values for a fragment of theplurality of fragments. The plurality of subpixel depth values iscalculated using the depth value and the slope of the depth value of thefragment. The method and system comprise determining whether to store aportion of the fragment based on the plurality of subpixel depth valuesfor the fragment and the indication of the extent the correspondingpixel is intersected by the fragment. The method and system alsocomprise storing the portion of the fragment if it has been determinedthat the portion of the fragment is to be stored. The method and systemalso comprise repeating the calculating, determining, and storing stepsfor each remaining fragment in the portion of the plurality offragments. The method and system also comprise providing antialiaseddata for the pixel based on a second portion of the plurality offragments that have been stored.

[0011] According to the system and method disclosed herein, the presentinvention can provide antialiasing for implicit edges. The antialiasingis provided without requiring a frame buffer or z-buffer. Furthermore,the present invention does not slow processing of the image by requiringan inordinate number of calculations.

BRIEF DESCRIPTION OF THE DRAWINGS

[0012]FIG. 1A is a diagram of a graphical image including an implicitedge.

[0013]FIG. 1B is a closer view of the implicit edge shown in FIG. 1A.

[0014]FIG. 2 is a block diagram depicting a computer graphics system inaccordance with the present invention.

[0015]FIG. 3 is a high level flow chart depicting a method for providinga graphical display including antialiasing in accordance with thepresent invention,

[0016]FIG. 4 is a more detailed flow chart depicting a method forproviding a graphical display including antialiasing in accordance withthe present invention.

[0017]FIG. 5 is a flow chart depicting one embodiment of a method forperforming the step of determining the subpixels in which the subpixeldepth values for the fragment is less than stored subpixel depth values.

[0018]FIG. 6A is a diagram of a pixel in the display of a computergraphics system in which two polygons and an implicit edge are desiredto be shown.

[0019]FIG. 6B is a diagram of the pixel of FIG. 6A in addition tosubpixels within the pixel.

[0020]FIG. 7A is a diagram of a coverage mask indicating the portion ofthe pixel that the first polygon intersects.

[0021]FIG. 7B is a diagram of a second mask indicating the subpixels inwhich the first polygon would or does have a subpixel depth value whichless than a stored subpixel depth value.

[0022]FIG. 7C is a diagram of the intersection of the coverage andsecond masks for the first polygon.

[0023]FIG. 7D is a diagram of the data stored in the subpixel bufferincluding data for the first polygon.

[0024]FIG. 8A is a diagram of a coverage mask indicating the portion ofthe pixel that the second polygon intersects.

[0025]FIG. 8B is a diagram of a second mask indicating the subpixels inwhich the second polygon would or does have a subpixel depth value whichless than a stored subpixel depth value.

[0026]FIG. 8C is a diagram of the intersection of the coverage andsecond masks for the second polygon.

[0027]FIG. 8D is a diagram of the data stored in the subpixel bufferincluding data for the second polygon.

DETAILED DESCRIPTION OF THE INVENTION

[0028] The present invention relates to an improvement in renderinggraphical images. The following description is presented to enable oneof ordinary skill in the art to make and use the invention and isprovided in the context of a patent application and its requirements.Various modifications to the preferred embodiment will be readilyapparent to those skilled in the art and the generic principles hereinmay be applied to other embodiments. Thus, the present invention is notintended to be limited to the embodiment shown but is to be accorded thewidest scope consistent with the principles and features describedherein.

[0029]FIG. 1A is a diagram of a graphical image on a display 10containing two intersecting polygons 20 and 30. The polygons 20 and 30may be part of objects which are part of a graphical image being shownon the display 10. The first polygon 20 includes edges 22, 24, and 26.The second polygon 30 includes edges 32, 34, and 36. The edges 22, 24,26, 32, 34, and 36 are, therefore, explicitly defined. At theintersection of the polygons 20 and 30, there is an implicit edge 12.The implicit edge 12 is not explicitly defined, but is due to theintersection of polygons 20 and 30. Portion 28 of the polygon 20 ispartially occluded by the polygon 30. Portion 38 of the polygon 30 ispartially occluded by the polygon 20. FIG. 1B depicts a closer view of aportion of the implicit edge 12. The pixels in the display have a finitearea and are depicted as squares. Because the pixels in the display 10have a finite size, the edges 22 and 32 as well as the implicit edge 12are jagged.

[0030]FIG. 2 depicts a simplified block diagram of one embodiment of acomputer graphics system 100 with which the present invention is used.Portions of the computer system 100 are described more completely inco-pending U.S. patent application Ser. No. 08/624,261 entitled “Methodand Apparatus for Identifying and Eliminating Three-Dimensional ObjectsVisually Obstructed from a Planar Surface” filed on Mar. 29, 1996.Applicant hereby incorporates by reference the above-mentionedco-pending application. The present invention is also related toco-pending U.S. patent application Ser. No. 08/624,260 entitled“Graphics Processors, System and Method for Generating Screen Pixels inRaster Order Utilizing a Single Interpolator” filed on Mar. 29, 1996.Applicant hereby incorporates by reference the above-mentionedco-pending application.

[0031] The computer graphics system 100 includes a central processingunit (CPU) 102, a display 104, a user interface 106 such as a keyboardor mouse or other communicating device, a memory 110, and an imagegenerating unit 120 coupled with a bus 108. The display 104 includes aplurality of pixels, not shown. Each of the plurality of pixels has anarea. The display 104 could include a display memory (not shown) towhich pixels are written. For example, the display 104 could include aframe buffer. However, the present invention can also be implementedwithout a frame buffer. However, nothing prevents the method and systemfrom being implemented in a different computer system having othercomponents. The system 100 is used to display objects, particularlythree-dimensional objects. In order to do so, each of the objects ispreferably broken into polygons to be used in rendering the objects. Ina preferred embodiment, the polygons are rendered in raster order. Thatis, portions of the polygons are rendered in the order of the pixels inthe display 104.

[0032] The image generating unit 120 includes an interface 121 connectedto the bus 108. The interface 121 transmits data to a data processingunit 122. A processor block 124 is coupled with the data processing unit122. The processor block 124 identifies data describing portions ofpolygons (“intersecting polygons”) which intersect the area extendingalong a z-axis from a selected pixel in an x-y plane corresponding to ascreen of the display 104. In a preferred embodiment, the processorblock 124 includes a sufficient number of processors to have a separateprocessor for each intersecting polygon. Consequently, the intersectingpolygons can be processed in parallel. The data for with the portion ofthe intersecting polygon associated with the selected pixel is termed afragment. For example, a fragment includes the color, texture, and depthvalue for the corresponding polygon. Data relating to each selectedpixel includes a fragment for each of the intersecting polygons. In thecontext of this disclosure, a fragment for an intersecting polygon willbe described as intersecting the pixel that the polygon intersects. Theprocessor block 124, therefore, provides and indication of the fragmentsthat intersect a pixel currently being processed.

[0033] An obstructed object identifier/removal unit 126 receives atleast a portion of the fragment from each intersecting polygonassociated with the selected pixel and removes portions of the fragmentsfor the intersecting polygons which are obstructed. In one embodiment,the obstructed objected identifier/removal unit 126 performs thisfunction by indicating to the interpolator which fragments are valid(unobstructed) and which fragments are invalid (obstructed). In apreferred embodiment, the obstructed object identifier/removal unit 126performs this function without determining the precise z-value of thepolygon.

[0034] The interpolator 128 receives the fragments for the intersectingpolygons for the selected pixel and interpolates the data, includinginterpolating texture, color, and alpha values for the fragment. Theinterpolator 128 also provides a mask, discussed below, for eachfragment. Although mask generation can be considered logically distinctfrom interpolation, the mask is preferably generated by a sub-block (notshown) of the interpolator 128. However, in an alternate embodiment,mask generation can be provided by another unit. The mask can beconsidered part of the fragment for an intersecting polygon. Because theobstructed object identifier/removal unit 126 has removed fragments forobstructed objects, the interpolator 128 may perform its function foronly those intersecting polygons which are not obstructed. The fragmentsfor these remaining intersecting polygons are provided by theinterpolator 128 to a hardware sorter 130. The hardware sorter 130 sortsthe fragments for the intersecting polygons based on the value of a keyassociated with the fragment. Preferably, the key is the z value, ordepth value, for the fragment at the selected pixel. Note, however, thatthe present invention is consistent with other sorts or with no sort.

[0035] The sorted fragments for the selected pixel are then provided toan antialiasing unit 140. In a preferred embodiment, the antialiasingunit 140 includes a z mask unit 141, an accumulator 142, and blendingunit(s) 144. The accumulator 142 includes subpixel buffers, not shown inFIG. 2. In a preferred embodiment, the accumulator 142 includes aseparate subpixel buffer for each subpixel into which a pixel isdivided. In a preferred embodiment, a single blending unit 144 is used.In an alternate embodiment, multiple blending units 144 can be used. Theantialiased data for the selected pixel is provided to the display 104.Subsequent pixels are then identified as the selected pixel beingprocessed, preferably in raster order. The fragments intersecting thesepixels are processed similarly. Thus, the objects in the graphical imagecan be rendered in raster order.

[0036] Antialiasing using the masks provided by the interpolator 128 isdescribed in co-pending U.S. patent application Ser. No. 09/239,413,entitled “METHOD AND SYSTEM FOR PROVIDING EDGE ANTIALIASING” (JAS 945P)filed on Jan. 28, 1999 and assigned to the assignee of the presentapplication. Applicant hereby incorporates by reference theabove-mentioned co-pending application.

[0037] In the above-mentioned co-pending application, each fragmentincludes but is not limited to a mask and a depth value. The maskindicates a portion of the pixel that the fragment intersects. Thus, themask is hereinafter referred to as a coverage mask. The coverage mask isused to determine the contribution a fragment makes to the pixel itintersects. For example, each pixel can be broken into subpixels. Thecoverage mask indicates which of the subpixels the fragment intersects.Where a particular pixel includes an edge of a polygon, such as the edge122, the coverage mask for the fragment indicates that the fragment onlyintersects some of the subpixels. The fragment is blended only in thesesubpixels. In order to blend the fragment, the accumulator 142 andblending units 144 are used. Each subpixel buffer in the accumulator 142is used to store information for fragments contained in each of thesubpixels within the selected pixel. In a preferred embodiment, the datain the subpixel buffers in the accumulator 142 is averaged. Theantialiased data for the selected pixel is then provided to the display104.

[0038] Although the method and system described in the above-mentionedco-pending application functions adequately for its intended purpose,antialiasing of implicit edges may not be adequately addressed. Althoughthe coverage mask for a fragment indicates the subpixels that thefragment actually intersects, the remaining data in each fragment in theabove-mentioned co-pending application contains data which is presumedto be identical in every subpixel. Thus, depth value is the same foreach subpixel in a selected pixel. Implicit edges are due to differencesin the depth value for polygons, such as the polygons 20 and 30. Thus,the antialiasing described in the above-mentioned co-pending applicationmay not adequately antialias implicit edges. Accordingly, what is neededis a method and system for providing antialiasing which is capable ofantialiasing implicit edges.

[0039] The present invention provides a method and system for providingantialiasing of a graphical image on a display from data describing atleast one object. The display includes a plurality of pixels. The methodand system comprise providing a plurality of fragments for the at leastone object. A portion of the plurality of fragments intersects a pixelof the plurality of pixels. Each of the plurality of fragments includesa depth value, a slope of the depth value, and an indication of aportion of a corresponding pixel that is intersected. The method andsystem comprise calculating a plurality of subpixel depth values for afragment of the plurality of fragments. The plurality of subpixel depthvalues is calculated using the depth value and the slope of the depthvalue of the fragment. The method and system comprise determiningwhether to store a portion of the fragment based on the plurality ofsubpixel depth values for the fragment and the indication of the extentthe corresponding pixel is intersected by the fragment. The method andsystem also comprise storing the portion of the fragment if it has beendetermined that the portion of the fragment is to be stored. The methodand system also comprise repeating the calculating, determining, andstoring steps for each remaining fragment in the portion of theplurality of fragments. The method and system also comprise providingantialiased data for the pixel based on a second portion of theplurality of fragments that have been stored.

[0040] The present invention will be described in terms of a particularcomputer system and processing fragments in a particular order. However,one of ordinary skill in the art will readily recognize that this methodand system will operate effectively for other types of computer systemsand processing fragments in another order. Furthermore, although thepresent invention is described in the context of antialiasing implicitedges, the present invention can be used in antialiasing other items,such as edges or lines. Furthermore, the present invention will bedescribed in the context of specific blocks performing certain functionsand methods performing certain steps in a particular order. However, oneof ordinary skill in the art will readily realize that other blocks canprovide these functions and that the steps may be performed in anotherorder or in parallel.

[0041] To more particularly illustrate the method and system inaccordance with the present invention, refer now to FIG. 3 depicting ahigh-level flow chart of one embodiment of a method 200 in accordancewith the present invention. The method 200 provides antialiasing forfragments intersecting a selected pixel of the display 104. The method200 preferably processes the fragments intersecting the selected pixelone at a time. Furthermore, each pixel can be divided into a pluralityof subpixels. In a preferred embodiment, each pixel is divided into afour by four array of subpixels.

[0042] The fragments for the objects being displayed are provided, viastep 205. Each of the fragments provided in step 205 includes a depthvalue, a slope of the depth value, and an indication of the portion ofthe pixel that the fragment intersects. In a preferred embodiment, eachfragment includes the coverage mask, discussed above, as an indicationof the extent to which the pixel is intersected. The coverage masksindicates the subpixels which the fragment intersects. The fragment mayalso include the color, blending modes, minimum and maximum z values forthe object, texture, and other data. In a preferred embodiment, thedepth value is a z value. However, nothing prevents the use of anothermeasurement of depth, such as w or layer order, from being used as thedepth value. The slope of the depth value indicates how the depth valuefor the fragment varies across the pixel. For example, where the depthvalue is z, the slope of the depth value preferably includes horizontaland vertical components, dz/dx and dz/dy, respectively. In a preferredembodiment, the slope of the depth value is constant. This eases thecalculations discussed below. For planar polygons, the slope of thedepth value is constant because the depth value varies linearly.However, the depth values for a polygon may not vary linearly if thepolygon is not planar.

[0043] However, over small distances, higher order functions can beapproximated linearly. Thus, even where the depth values for the polygondo not vary linearly, the slope of the depth value can be a linearapproximation of the actual slope of the depth value for the polygon ofwhich the fragment is a part.

[0044] A plurality of subpixel depth values for a fragment intersectinga selected pixel are calculated, via step 210. The z mask unit 141preferably carries out step 210. The subpixel depth values arecalculated using the depth value and the slope of the depth value. In apreferred embodiment, a subpixel depth value is calculated for eachsubpixel using the horizontal and vertical components of the slope ofthe subpixel depth value and the depth value. For example, assume thatthe depth value for the fragment is z₁. This depth value is presumed tobe for a particular point in the pixel. Each subpixel may be consideredto be a distance of ax₁ and by₁ in the x and y directions, respectively,from the point at which the depth value has previously been calculated.In this case, a and b represent the number of subpixels in the x and ydirections, respectively, between the point at which the depth value isknown and the subpixel for which the subpixel depth value is calculated.The subpixel depth value is z=z₁+ax₁(dz/dx)+ay₁(dz/dy). Note that a andb need not be integers. Thus, the subpixel depth value may be calculateda fractional number of subpixels from the point at which z₁ is takenevaluated. In a preferred embodiment, the subpixel depth value iscalculated for each subpixel regardless of whether the coverage maskindicates that the fragment actually intersects that subpixel. However,in another embodiment, the subpixel depth value may be calculated foronly those subpixels which the fragment intersects.

[0045] Once the subpixel depth values are known, it is determinedwhether to store the fragment, via step 220. This determination is basedon the subpixel depth values and the portion of the pixel that thefragment intersects. Preferably, this determination is made by the zmask unit 141 using the subpixel depth values and the coverage mask. Viastep 225, a portion of the fragment is then stored for some or all ofthe subpixels if it was determined in step 220 that the fragment was tobe stored. In order to store the portion of the fragment in step 225,data for the fragment is replicated for each of the appropriatesubpixels and, using the blending unit(s) 144, stored in thecorresponding subpixel buffers of the accumulator 142. For example, allsubpixel buffers in which the fragment is stored in step 225 will holdthe same color and texture values for the fragment. In a preferredembodiment, step 225 stores data for the fragment for each subpixel thefragment intersects and in which the depth value is less than a storeddepth value. Step 225 may also include blending the data for translucentfragments.

[0046] Steps 210 through 225 are then repeated for each remainingfragment that intersects the pixel, via step 230. Thus, after step 230is completed, the subpixel buffers in the accumulator 142 should holddata relating to the fragments which contribute to the pixel.Antialiased data for the pixel is then provided to the display 104, viastep 240. In one embodiment, step 240 includes averaging the data in thesubpixel buffers to provide the data for the pixel. Step 240 may alsoinclude providing the data for the pixel to memory in the display 104.In the preferred embodiment, a depth value is selected from one of thesubpixel buffers as the depth value for the pixel. Selecting one of thedepth values instead of providing an average should not adversely affectthe data provided for the pixel because the depth values for thesubpixels will probably be very similar. Furthermore, computation timeis reduced.

[0047]FIG. 4 depicts a more detailed flow chart of a preferredembodiment of the method 250 for providing antialiasing that canantialias implicit edges. Fragments for the objects in the graphicalimage are provided, via step 205′. Step 205′ corresponds to step 205depicted in FIG. 3. Thus, each fragment includes a depth value, a slopeof the depth value, and an indication of the portion of the pixel thatthe fragment intersects. In a preferred embodiment, each fragmentincludes the coverage mask, discussed above, as an indication of theextent to which the pixel is intersected. The coverage masks indicatesthe subpixels that the fragment intersects.

[0048] Referring back to FIG. 4, subpixel depth values are calculatedfor a fragment intersecting a selected pixel, via step 210′. Step 210′corresponds to step 210 of the method 200. In a preferred embodiment,the subpixel depth values are calculated for each subpixel regardless ofwhether the fragment actually intersects the subpixel. The subpixelswhich have a subpixel depth value less than a stored subpixel depthvalue and which the fragment intersects are then determined, via step222. Steps 210′ and 222 are preferably performed using the z mask unit141. For the first fragment processed, step 222 will indicate thatsubpixel depth values are less than all stored subpixel depth values.This is because a background subpixel depth value which may be stored inthe subpixel buffers will have a higher depth value. For subsequentfragments processed, the subpixel depth values may be less than thestored subpixel depth value in any number of the subpixels.

[0049] Via step 228, the fragment is stored in the subpixel bufferscorresponding to the subpixels determined in step 222. Thus, thefragment is stored in subpixel buffers for subpixels in which thesubpixel depth value calculated in step 210′ is less than a storedsubpixel depth value and which the fragment actually intersects. Inorder to store the fragment in step 228, the data for the fragment isreplicated in the subpixel buffer(s) in which the fragment is to bestored. In addition, step 228 may include blending the fragment's datawith data previously stored in each of the subpixel buffers if some ofthe fragments intersecting the subpixel buffer are translucent. Thus,color, texture, and other data relating to the fragment need not beindependently evaluated at each subpixel. Instead, the fragment's datais provided to the appropriate subpixels.

[0050] Steps 210′ through 228 are then repeated for each remainingfragment that intersects the selected pixel, via step 230′. Antialiaseddata for the pixel is then provided, via step 240′. Step 240′ isanalogous to step 240 and may provide the antialiased data to a memory,such as a frame buffer, in the display 104 or directly to a monitor (notshown) or other mechanism for displaying the data to a user. Thus, thefragments intersecting the selected pixel are rendered. Steps 210′through 240′ are then repeated for each remaining pixel, via step 252.Thus, each pixel in the display is rendered. Preferably, the method 250renders the objects displayed pixel by pixel in raster order.

[0051]FIG. 5 depicts a preferred embodiment of step 222, determining thesubpixels that have a subpixel depth value less than a stored subpixeldepth value and that the fragment intersects. Using the z mask unit 141,a depth comparison for each subpixel is provided, via step 223. Step 223includes comparing the subpixel depth values for the fragment to thestored subpixel depth values from a previous fragment or the background.A depth mask is then generated, via step 224. The depth mask indicatesthe subpixels in which the subpixel depth value for the fragment is lessthan a stored subpixel depth value. In a preferred embodiment, the depthmask includes a one for each subpixel for which the fragment's subpixeldepth value is less than the stored subpixel depth value. Theintersection between the depth mask for the fragment and the coveragemask for the fragment is then determined, via step 226. Preferably, step226 includes performing a logical AND between the depth mask and thecoverage mask. The logical AND performed in step 226 can generate atotal mask indicating the subpixels that the fragment intersects and forwhich the subpixel depth value for the fragment is less than a storedsubpixel depth value. In a preferred embodiment, the z mask unit 141includes its own accumulator (not shown) storing depth information foreach subpixel. The comparison performed in step 223 compares thesubpixel depth values for the fragment with the subpixel depth valuesstored in the accumulator of the z mask unit 141. The depth mask iscalculated based on this comparison. The intersection of the depth maskand the coverage mask can be used to update the depth values stored inthe accumulator of the z mask unit 141 as well as to determine whichsubpixel buffers of the accumulator will be updated. Note that the totalmask generated in step 226 can be viewed as a modification of thecoverage mask for the fragment. The coverage mask is modified by the zmask. Thus, the function of the z mask unit 141 can be considered to bemodifying the coverage mask based on the subpixel depth values for thefragment. Once the total mask has been generated, data for the fragmentis stored in the subpixel buffers using step 228 of the method 250.

[0052] Because the depth value is accounted for at the subpixel level,implicit edges may be antialiased. Data such as color or texture for thefragments are simply stored in the appropriate subpixels, rather thanbeing independently evaluated for each subpixel. For example, for eachfragment there is a single color in each of the appropriate subpixels.Consequently, the methods 200 and 250 in accordance with the presentinvention are less calculation intensive than conventionalsupersampling. The methods 200 and 250 in accordance with the presentinvention are faster and require less memory than conventionalsupersampling.

[0053] To further describe the method and system in accordance with thepresent invention, refer to FIG. 6A depicting a pixel 300 in which aportion of the two polygons 20 and 30 intersect. Thus, the pixel 300depicts a portion of the implicit edge 12 and portions of the polygons20 and 30. The pixel 300 also includes a background 370. FIG. 6B alsodepicts the pixel 300, the polygons 20 and 30, the implicit edge 12, andthe background 370. FIG. 6B also depicts sixteen subpixels 301 through316 within the pixel 300. In the following discussion, it is presumedthat the fragment for the polygon 20 is processed first, followed by thefragment for the polygon 30.

[0054]FIGS. 7A through 7C depict masks for the fragment for polygon 20.FIG. 7A depicts the coverage mask 320 for the polygon 20. The coveragemask 320 includes ones in the subpixels 301, 305-306, 309-311, and313-316. Thus, the polygon 20 covers the lower left half of the pixel300.

[0055]FIG. 7B depicts the depth mask 322 for the fragment for thepolygon 20. The depth mask 322 is generated in step 224 of FIG. 5.Referring back to FIG. 7B, because the fragment for the polygon 20 isprocessed first, the subpixel depth values for the polygon 20 will beless than the stored (background) subpixel depth values for eachsubpixel. Consequently, the depth mask 322 has a one for each of thesubpixel 301-316.

[0056] In order to determine for which subpixels the fragment's data isto be stored, the coverage mask 320 and the depth mask 322 areintersected using step 226 of FIG. 5. FIG. 7C depicts the total mask 324generated by the intersection. The total mask 324 has ones for eachsubpixel in which both the coverage mask 320 and the depth mask 322 hasa one. Consequently, the total mask has ones for subpixels 301,305-306,309-311, and 313-316.

[0057]FIG. 7D depicts the subpixel buffers 331-346 in the accumulator142 after the portion of the fragment for the polygon 20 has been storedusing step 228 of FIG. 4. Referring back to FIG. 7D, an “a” indicatesdata from the fragment for the polygon 20. An “x” indicates backgrounddata. As indicated by the mask 324, data for the fragment for thepolygon 20 has replaced background data in the subpixel buffers 331,333-334, 339-341, and 343-346.

[0058] Next, the fragment for the polygon 30 is processed. FIGS. 8Athrough 8C depict masks for the fragment for polygon 30 in the pixel300. FIG. 8A depicts the coverage mask 350 for the polygon 30. Thecoverage mask 350 includes ones in the subpixels 304, 307-308, 310-312,and 313-316. Thus, the polygon 30 covers the lower right half of thepixel 300.

[0059]FIG. 8B depicts the depth mask 352 for the fragment for thepolygon 30. The depth mask 352 is generated in step 224 of FIG. 5.Referring back to FIG. 8B, the polygon 30 has subpixel depth values thatare less than the background. In the right half of the pixel 300, thepolygon 30 has subpixel depth values that are less than the subpixeldepth values for the polygon 20. The subpixel depth values for thepolygon 30 will be less than the stored subpixel depth values in everysubpixel containing data for the background and in the 20 subpixelscontaining data for the polygon 20 that are in the right half of thepixel 300. Consequently, the depth mask 352 has a one for each thesubpixels 302-304, 307-308, 311-312, and 315-316.

[0060] To determine the subpixels in which the fragment's data is to bestored, the coverage mask 350 and the depth mask 352 are intersectedusing step 228 of FIG. 5. FIG. 8C depicts the total mask 354 generatedby the intersection. The total mask 354 has ones for each subpixel inwhich both the coverage mask 350 and the depth mask 352 has a one.Consequently, the total mask 352 has ones for subpixels 304, 307-308,311-312, and 315-316.

[0061]FIG. 8D depicts the subpixel buffers 331-346 in the accumulator142 after a portion of the second polygon 30 has been stored using step228 of FIG. 4. Referring back to FIG. 8D, a “b” indicates data from thefragment for the polygon 30. As indicated by the mask 354, data for thefragment for polygon 30 replaces background data in the subpixel buffers334, 337-338, and 342. Data for the fragment for polygon 30 alsoreplaces data from the fragment for the first polygon 20 in subpixelbuffers 341, 345, and 346. Since fragments for both polygons 20 and 30that intersect the pixel 300 have been processed, the final antialiaseddata for the pixel 300 can be provided from the subpixel buffers 331-346using step 240 or 240′ of the methods depicted in FIGS. 3 and 4.Referring back to FIG. 8D, the data in each of the subpixel buffers maybe combined and averaged or otherwise blended to provide antialiaseddata for the pixel.

[0062] Because the variation in depth values over a pixel are accountedfor, the method and system in accordance with the present inventionallow for antialiasing implicit edges as well as explicit edges orlines. Furthermore, the subpixel depth values are calculated forantialiasing. The subpixels depth values are not stored with thefragment throughout processing. Since the slope of the depth value ispresumed constant across a pixel, the slope of the depth value need notbe calculated for each subpixel. Where the polygons are also planar, theslope of the depth value can be calculated only once for the entirepolygon. Other attributes, such as color and texture, are also notevaluated individually at each subpixel. Instead, the data for thefragment is simply copied for the appropriate subpixels. Therefore, themethod and system in accordance with the present invention requires lesstime and consumes less memory than conventional supersampling.Therefore, antialiasing of implicit edges can be accomplished morequickly and without utilizing as much memory.

[0063] A method and system has been disclosed for providing antialiasingwhich uses masks and the depth values for each subpixel. Because onlythe slope of the depth value is stored within the fragment, less memoryis required to store a particular fragment. Furthermore, antialiasing ofimplicit edges can be provided in a system which uses less memory thanconventional supersampling. Furthermore, since the same values forcolor, texture, and data in a fragment other than the z value can bereplicated at each subpixel, computation time is reduced. Although thepresent invention has been described in accordance with the embodimentsshown, one of ordinary skill in the art will readily recognize thatthere could be variations to the embodiments and those variations wouldbe within the spirit and scope of the present invention. Accordingly,many modifications may be made by one of ordinary skill in the artwithout departing from the spirit and scope of the appended claims.

What is claimed is:
 1. A method for providing antialiasing of agraphical image on a display from data describing at least one object,the display including a plurality of pixels, the method comprising thesteps of: (a) providing a plurality of fragments intersecting for the atleast one object, a portion of the plurality of fragments intersecting apixel of the plurality of pixels, each of the plurality of fragmentsincluding a depth value, a slope of the depth value, and an indicationof a portion of a corresponding pixel that is intersected; (b)calculating a plurality of subpixel depth values for a fragment of theplurality of fragments, the plurality of subpixel depth valuescalculated using the depth value and the slope of the depth value of thefragment; (c) determining whether to store a portion of the fragmentbased on the plurality of subpixel depth values and the indication ofthe extent the corresponding pixel is intersected for the fragment; (d)storing the portion of the fragment if it has been determined in step(c) that the portion of the fragment is to be stored; (e) repeatingsteps (b) through (d) for each remaining fragment in the portion of theplurality of fragments; and (f) providing antialiased data for the pixelbased on a second portion of the plurality of fragments that have beenstored.
 2. The method of claim 1 wherein the method further includes thesteps of: (g) repeating steps (b) through (f) for each remaining pixelof the plurality of pixels.
 3. The method of claim 1 wherein each of theplurality of pixels can be divided into a plurality of subpixels,wherein the indication of the extent the corresponding pixel isintersected includes a coverage mask, the coverage mask indicating afirst portion of the plurality of subpixels which the fragmentintersects and wherein the determining step (c) further includes thesteps of: (c1) determining a second portion of the plurality ofsubpixels in a portion of the plurality of subpixel depth values is lessthan a portion of a plurality of stored subpixel depth values, thesecond portion of the plurality of subpixels being within the firstportion of the plurality of subpixels; and wherein the storing step (d)includes the step of (d1) storing the portion of the fragment for thesecond portion of the plurality of subpixels.
 4. The method of claim 3wherein the determining step (c1) further includes the step of: (c1i)comparing the plurality of subpixel depth values to the plurality ofstored subpixel depth values to determine a third portion of theplurality of subpixels in which a corresponding subpixel depth value ofthe plurality of subpixel depth values is less than a correspondingstored subpixel depth value of the plurality of stored subpixel depthvalues; (c1ii) providing a second mask for the fragment, the second maskindicating the third portion of the plurality subpixels; and (c1iii)using the coverage mask and the second mask for the fragment todetermine the second portion of the plurality of subpixels.
 5. Themethod of claim 4 wherein the determining step (c1ii) further includesthe step of: (c1iia) performing an AND operation for the coverage maskand the second mask.
 6. The method of claim 3 wherein the antialiaseddata providing step (f) further includes the step of: (f1) averaginginformation stored relating to the portion of the plurality of fragmentsthat intersect the pixel.
 7. The method of claim 3 wherein theantialiased data providing step (f) further includes the steps of: (f1)averaging currently stored information, other than the depth value,relating to the portion of the plurality of fragments that intersect thepixel; and (f2) selecting a currently stored median subpixel depth valueas the depth value for the pixel.
 8. A system for providing antialiasingof a graphical image from data describing at least one object includinga plurality of fragments, each fragment including a coverage mask, adepth value, and a slope of the depth value, the system comprising: adisplay including a plurality of pixels; means coupled to the displayfor providing a plurality of fragments for the at least one object, theplurality of fragments intersecting the plurality of pixels, each of theplurality of fragments including a depth value, a slope of the depthvalue, and an indication of a portion of a corresponding pixel that isintersected; an antialiasing unit, coupled with the display, forproviding antialiasing of each of the plurality of fragments based onthe depth value, the slope of the depth value, and the indication of theextent a corresponding pixel is intersected.
 9. The system of claim 8wherein the plurality of fragments are rendered in raster order.
 10. Thesystem of claim 8 wherein each pixel includes a plurality of subpixels,wherein the indication of an extent a corresponding pixel is intersectedincludes a coverage mask, the coverage mask indicating a first portionof the plurality of subpixels of the corresponding pixel which areintersected, and wherein the antialiasing unit further includes: meansfor calculating a plurality of subpixel depth values for the pluralityof fragments and for determining whether to store a portion of each ofthe plurality of fragments based on the plurality of subpixel depthvalues and the coverage mask for each of the plurality of fragments, theplurality of subpixel depth values calculated using the depth value andthe slope of the depth value for each of the plurality of fragments; aplurality of subpixel buffers, coupled with the calculating anddetermining means; and means coupled with the plurality of subpixelbuffers for providing an antialiased data for the plurality of fragmentsbased on a second portion of the plurality of fragments that have beenstored.
 11. The system of claim 10 wherein the coverage mask indicates afirst portion of the plurality of subpixels that each of the pluralityof fragments intersects and wherein the calculating and determiningmeans further includes: means for determining a second portion of theplurality of subpixels in which a portion of the plurality of subpixeldepth values is less than a portion of a plurality of stored depthvalues, the second portion of the plurality of subpixels being withinthe first portion of the plurality of subpixels; and wherein theplurality of subpixel buffers store the portion of the fragmentcorresponding to the second portion of the plurality of subpixels. 12.The system of claim 11 wherein the calculating and determining meansfurther includes: means for providing a second mask for the fragment,the second mask indicating a third portion of the plurality subpixels inwhich the portion of the plurality of subpixel depth values are lessthan the portion of the plurality of stored subpixel depth values; andmeans for using the coverage mask and the second mask for the fragmentto determine the second portion of the plurality of subpixels.
 13. Thesystem of claim 12 wherein the mask using means further includes: meansfor performing an AND operation for the coverage mask and the secondmask.
 14. The system of claim 13 wherein the antialiased pixel providingmeans further average information stored relating to the portion of theplurality of fragments that intersect the pixel.
 15. The system of claim14 wherein the antialiased pixel providing means further averagecurrently stored information, other than the depth value, relating tothe portion of the plurality of fragments that intersect the pixelselect a currently stored subpixel depth value as the depth value forthe pixel.